IF exists(SELECT * FROM dbo.sysobjects WHERE name='WEB_lokalenInfo' AND xtype='P') 
BEGIN
	DROP PROCEDURE WEB_lokalenInfo
END
GO

CREATE   procedure WEB_lokalenInfo
as
set nocount on

select '0AAAA' as lokaal,'<?xml version="1.0"  encoding="ISO-8859-1" ?><lokalen>' as tekst
union
select distinct isNull(Lokalen,'WWWWW'),'<lokaal soort="' + isnull(omschrijving,'-')+ '" projector="' + isnull(projector,'-')+ '" projectiescherm="' + isnull(projectiescherm,'-')+ '"
				netwerk="' + isnull(netwerk,'-') + '"
 		                tv="' + isnull(tv,'-') + '"
				video="' + isnull(video,'-') + '"
				DVD="' + isnull(dvd,'-') + '"
				pc="' + isnull(pc,'-')+ '"
                                tafels="' + isnull(convert(varchar(2),tafels),'-') + '"
                                stoelen="' + isnull(convert(varchar(2),stoelen),'-')
         + '">' + isNull(rtrim(Lokalen),'') + '</lokaal>'
from lokalenvolgorde
union
select 'ZZZZZ','</lokalen>'
order by lokaal